package com.huaru.message.config;

import com.glch.fkj398.msgservice.handler.netty.StartupEvent;
import com.huaru.message.scheduling.CourseInfoThred;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * Author: hth
 * Remark:
 * Time: 2023/6/6 15:28
 */
//@Component
@Configuration
//@Order(2)
public class StartMessage  implements CommandLineRunner {
    private  static Logger logger = LoggerFactory.getLogger(StartMessage.class);
    public static CourseInfoThred COURSEINFOTHRED;
    @Override
    public void run(String... args) throws Exception {
        try {
            //启动站间通信开启 之前端口号5476
            new Thread(() -> new StartupEvent().receiveUdpdata(6947)).start();
            logger.info("站间通信开启成功.....");
        }catch (Exception e){
            e.printStackTrace();
            logger.info("站间通信开启失败.....");
        }
    }
}
